Defines a planar, closed-loop linkage operating within the x-y plane. Each independent loop within the mechanism contributes three loop-closure constraint equations, avoiding the redundant equations that arise when a planar mechanism is analyzed in three dimensions.
All joints must be usable within a planar mechanism, and all link geometry must be arranged such that motion remains within the x-y plane.
Initializes a new planar_linkage object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(link_container), | intent(in), | dimension(:) | :: | lnks |
The collection of links forming the mechanism. |
|
| type(joint), | intent(in), | dimension(:) | :: | jnts |
The collection of joints connecting the links. Every joint must be usable within a planar mechanism. |
|
| integer(kind=int32), | intent(in), | optional | :: | base |
The index of the link that is fixed to ground. If not supplied, the first link is used. |
|
| integer(kind=int32), | intent(in), | optional | :: | effector |
The index of the link carrying the end-effector. If not supplied, the last link is used. |
|
| real(kind=real64), | intent(in), | optional | :: | tool(4,4) |
The transformation matrix relating the end-effector coordinate frame to the body frame of the end-effector link. If not supplied, an identity matrix is used. |
The resulting planar_linkage object.
Initializes a new planar_linkage object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(link), | intent(in), | dimension(:) | :: | lnks |
The collection of links forming the mechanism. |
|
| type(joint), | intent(in), | dimension(:) | :: | jnts |
The collection of joints connecting the links. Every joint must be usable within a planar mechanism. |
|
| integer(kind=int32), | intent(in), | optional | :: | base |
The index of the link that is fixed to ground. If not supplied, the first link is used. |
|
| integer(kind=int32), | intent(in), | optional | :: | effector |
The index of the link carrying the end-effector. If not supplied, the last link is used. |
|
| real(kind=real64), | intent(in), | optional | :: | tool(4,4) |
The transformation matrix relating the end-effector coordinate frame to the body frame of the end-effector link. If not supplied, an identity matrix is used. |
The resulting planar_linkage object.
Computes the transformation matrix relating the body coordinate frame of the requested link to the coordinate frame of the base link. The transformation is accumulated along the path through the mechanism's spanning tree.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
||
| integer(kind=int32), | intent(in) | :: | i |
The index of the link of interest (1 = first link). |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | q |
An array containing all of the mechanism's joint variables. |
The resulting 4-by-4 transformation matrix.
Computes the Jacobian matrix of the loop-closure constraint equations with respect to the mechanism's joint variables. The derivatives are estimated by means of a central difference approximation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | q |
An array containing all of the mechanism's joint variables. |
The resulting C-by-N matrix where C is the number of constraint equations and N is the number of joint variables.
Evaluates the loop-closure constraint equations for the mechanism. A valid configuration drives every equation to zero.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | q |
An array containing all of the mechanism's joint variables. |
An array containing the residual of each constraint equation.
Computes the planar pose of the end-effector.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(planar_linkage), | intent(inout), | target | :: | this |
The planar_linkage object. |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | q |
An array containing the actuated joint variables. |
A three-element array containing the x and y coordinates of the end-effector along with its orientation angle, in radians.
Computes the transformation matrix relating the end-effector coordinate frame to the coordinate frame of the base link.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | q |
An array containing all of the mechanism's joint variables. |
The resulting 4-by-4 transformation matrix.
Computes the forward kinematics for the mechanism resulting in a transformation matrix relating the end-effector coordinate frame to the coordinate frame of the base link.
Unlike a serial linkage, the forward kinematics of a closed-loop mechanism require the solution of the loop-closure constraints. The solution obtained depends upon the assembly mode of the mechanism, and therefore upon the starting estimate.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(inout), | target | :: | this |
The mechanism object. |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | q |
An array containing the actuated joint variables. The array must contain one value for each degree of freedom of the mechanism. |
|
| real(kind=real64), | intent(in), | optional, | dimension(:) | :: | qo |
An optional array containing an initial estimate of all of the mechanism's joint variables. If not supplied, the most recently computed configuration is used. |
| type(iteration_behavior), | intent(out), | optional | :: | ib |
An optional output that can be used to gather information on the solver. |
The resulting 4-by-4 transformation matrix.
Gets the indices, within the mechanism's array of joint variables, of the actuated joint variables.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
An array containing the indices of the actuated variables.
Gets the number of actuated joint variables.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
The number of actuated joint variables.
Extracts the actuated joint variables from a full set of joint variables.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | q |
An array containing all of the mechanism's joint variables. |
An array containing the actuated joint variables.
Gets the index of the link that is fixed to ground.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
The index of the base link.
Gets the most recently computed set of joint variables. This value is used as the starting estimate for subsequent solutions.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
An array containing all of the mechanism's joint variables.
Gets the number of loop-closure constraint equations imposed upon the mechanism.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
The number of constraint equations.
Gets the number of degrees of freedom, or mobility, of the mechanism. The value is the number of joint variables less the number of loop-closure constraint equations.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
The number of degrees of freedom.
Gets the index of the link carrying the end-effector.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
The index of the end-effector link.
Gets the requested joint object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
||
| integer(kind=int32), | intent(in) | :: | i |
The index of the joint to retrieve (1 = first joint). |
The requested joint.
Gets the number of joints in the mechanism.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
The joint count.
Gets the index, within the mechanism's array of joint variables, of the first variable belonging to the requested joint.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
||
| integer(kind=int32), | intent(in) | :: | i |
The index of the joint of interest (1 = first joint). |
The index of the joint's first variable.
Gets a pointer to the requested link object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in), | target | :: | this |
The mechanism object. |
|
| integer(kind=int32), | intent(in) | :: | i |
The index of the link to retrieve (1 = first link). |
A pointer to the requested link.
Gets the number of links in the mechanism.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
The link count.
Gets the number of independent kinematic loops in the mechanism.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
The number of independent loops.
Gets the dimension of the space in which the mechanism operates.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(planar_linkage), | intent(in) | :: | this |
The planar_linkage object. |
The value three, corresponding to two translations and one rotation.
Gets the transformation matrix relating the end-effector coordinate frame to the body frame of the end-effector link.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
The 4-by-4 transformation matrix.
Gets the total number of joint variables describing the configuration of the mechanism.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
The number of joint variables.
Solves the inverse kinematics problem for the mechanism. The loop-closure constraints are solved simultaneously with the end-effector constraints.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(inout), | target | :: | this |
The mechanism object. |
|
| real(kind=real64), | intent(in) | :: | trg(4,4) |
A transformation matrix relating the end-effector coordinate frame to the coordinate frame of the base link. This transformation matrix defines the end-effector target for the solver. |
||
| real(kind=real64), | intent(in), | optional, | dimension(:) | :: | qo |
An optional array containing an initial estimate of all of the mechanism's joint variables. If not supplied, the most recently computed configuration is used. |
| type(iteration_behavior), | intent(out), | optional | :: | ib |
An optional output that can be used to gather information on the solver. |
An array containing the actuated joint variables that satisfy the constraints.
Constructs the Jacobian matrix relating the actuated joint velocities to the velocity of the end-effector, as expressed in the end-effector coordinate frame.
The loop-closure constraints supply the relationship between the actuated and passive joint velocities. Partitioning the constraint Jacobian into its actuated and passive terms yields which is then combined with the end-effector Jacobian. The partition becomes singular at a configuration in which the mechanism loses control of one or more of its degrees of freedom.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(inout), | target | :: | this |
The mechanism object. |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | q |
An array containing the actuated joint variables. The array must contain one value for each degree of freedom of the mechanism. |
|
| real(kind=real64), | intent(in), | optional, | dimension(:) | :: | qo |
An optional array containing an initial estimate of all of the mechanism's joint variables. If not supplied, the most recently computed configuration is used. |
The resulting D-by-M matrix where D is the dimension of the space in which the mechanism operates and M is the number of actuated joint variables.
Computes the transformation matrix relating the body coordinate frame of a joint's child link to the body coordinate frame of the joint's parent link.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(in) | :: | this |
The mechanism object. |
||
| integer(kind=int32), | intent(in) | :: | i |
The index of the joint of interest (1 = first joint). |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | q |
An array containing all of the mechanism's joint variables. |
The resulting 4-by-4 transformation matrix.
Reduces a transformation matrix describing the deviation between two coordinate frames into a three-element error vector containing the in-plane translational errors and the rotation about the plane normal.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(planar_linkage), | intent(in) | :: | this |
The planar_linkage object. |
||
| real(kind=real64), | intent(in) | :: | x(4,4) |
The 4-by-4 error transformation matrix. |
The resulting three-element error vector.
Sets the set of joint variables used as the starting estimate for subsequent solutions. A reasonable estimate is important as a closed-loop mechanism typically admits multiple assembly modes.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(inout) | :: | this |
The mechanism object. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | q |
An array containing all of the mechanism's joint variables. |
Sets the transformation matrix relating the end-effector coordinate frame to the body frame of the end-effector link.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(inout) | :: | this |
The mechanism object. |
||
| real(kind=real64), | intent(in) | :: | x(4,4) |
The 4-by-4 transformation matrix. |
Determines the complete set of joint variables satisfying both the loop-closure constraints and the requested actuated joint variables.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(kinematic_mechanism), | intent(inout), | target | :: | this |
The mechanism object. |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | q |
An array containing the actuated joint variables. The array must contain one value for each degree of freedom of the mechanism. |
|
| real(kind=real64), | intent(in), | optional, | dimension(:) | :: | qo |
An optional array containing an initial estimate of all of the mechanism's joint variables. If not supplied, the most recently computed configuration is used. |
| type(iteration_behavior), | intent(out), | optional | :: | ib |
An optional output that can be used to gather information on the solver. |
An array containing all of the mechanism's joint variables.